package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(20);not null;unique;"`
	Password string `gorm:"type:char(32);not null;"`
}
type UserRealname struct {
	gorm.Model
	UserId   int64  `gorm:"type:int;"`
	Realname string `gorm:":type:varchar(20);"`
	IdCard   string `gorm:"type:char(18);"`
}

func (ur *UserRealname) Create() error {
	return DB.Debug().Create(&ur).Error
}
func (ur *UserRealname) CheckRealname(userid int64, idCard string) error {
	return DB.Debug().Where("user_id=? or id_card =? ", userid, idCard).Find(&ur).Error
}
